package com.ruoyi.web.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.utils.LoginUtils;
import com.ruoyi.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ruoyi.common.ums.entity.YytUmsIntegrationChangeHistory;
import com.ruoyi.common.ums.service.YytUmsIntegrationChangeHistoryService;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* <p>
    * 积分变化历史记录 前端控制器
    * </p>
*
* @author MrPing
* @since 2022-06-24
*/
@RestController
@RequestMapping("/integration")
public class YytUmsIntegrationChangeHistoryController{

    @Autowired
    private YytUmsIntegrationChangeHistoryService yytUmsIntegrationChangeHistoryService;

    /**
     * 获取用户积分
     * @return
     */
    @GetMapping("/pointStatementList")
    public ResponseResult pointStatementList(@RequestParam("memberId") String memberId){
        QueryWrapper<YytUmsIntegrationChangeHistory> wrapper = new QueryWrapper<>();
        wrapper.eq("member_id", memberId).orderByDesc("create_time");
        return ResponseResult.success(yytUmsIntegrationChangeHistoryService.list(wrapper));
    }


}
